<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page contentType="text/html;charset=UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<link href="themes/css/ui.common.css" rel="stylesheet" type="text/css" />
		<link href="themes/css/ui.child.css" rel="stylesheet" type="text/css"  />
		<link href="themes/css/ui.tips.css" rel="stylesheet" type="text/css" />
		<link href="themes/base/jquery.ui.button.css" rel="stylesheet"
			type="text/css" />
		<link id="skin_css" rel="stylesheet" type="text/css"
			href="themes/css/ui.c.blue.css" />
		<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
		<script src="Scripts/jquery-ui-1.8.custom.min.js"
			type="text/javascript"></script>
		<script src="Scripts/jquery.json-2.2.min.js" type="text/javascript"></script>
		<script src="Scripts/jquery.easyui.min.js" type="text/javascript"></script>
		<script src="Scripts/ui.admincp.js" type="text/javascript"
			charset="UTF-8"></script>
		<script src="Scripts/ui.tips.js" type="text/javascript"></script>
		<script src="Scripts/ui.default.js" type="text/javascript"
			charset="UTF-8"></script>
		<script src="page/goods/js/ui.editableObject.js" type="text/javascript"></script>
		<script src="page/goods/js/goodsOrderHandler.js" type="text/javascript"></script>
		<script src="page/goods/js/bussiness.goodsReturn.js" type="text/javascript"></script>
		<title>个人物资流通列表</title>
		<style>  
			.currentTabButton {
				background-color: gray;
				font-weight: bolder;
			}

			.currentTab {
				display: block;
			}
			
			.pageTab {
				display: none;
			}
</style>
		<script type="text/javascript">
		$(function(){
			registeToggleTabEvent();
			
		});
		
		function registeToggleTabEvent()
		{
			$(".pageTabButton").click(function(){
				var tabTarget = $(this).attr("targetTab");
				var thisId =$(this).attr("id");
				$(".pageTab").hide();
				
				if(tabTarget!=undefined)
					$(tabTarget).show();
				
				$(".pageTabButton").removeClass("currentTabButton");
				$(this).addClass("currentTabButton");
			});
			
			var currentButton = $(".currentTabButton:first");
			
			if(currentButton==null || currentButton.length<=0)
			  $(".pageTabButton:first").click();
			  else 
			  {
			      currentButton.click();
			  }
		}
	</script>
	<SCRIPT type="text/javascript">
			var searching = false;
				$(function(){
					$("#link_page_prev,#link_page_next").click(function(){
			    		var currentPage = $(this).attr("currentPage");
			    	 
			    		goToPage(currentPage);
			    	}); 
			    	
			    	$("#searchButton").click(function(){
						searching=true;
			    		goToPage(1);
			    	});
			    	
			    	initSearch();
			    	registeRowFuncButton();
				});
				
				function initSearch()
				{
				    $("#txt_noticeTitle").val();
				}
			 
				function goToPage(currentPage)
				{
				    var title = $("#txt_noticeTitle").val();
				    var place =$("#ddl_place").val(); 
					var states=$("#states").val();
				     
					location.href = "goodsOrder.action?currpage="+currentPage+"&states="+states;
				}   
				</SCRIPT>
	</head>
	<body>
		<div class="PageChild_Title">
			<img src=" themes/images/default/icons/archives.png"
				class="PageChild_Tbtnpic" />
			<span class="PageChild_separate"></span><span
				class="PageChild_TbtnText">
				<h2>
					查看物资申请
				</h2> </span><span class="PageChild_separate"></span>
				  <div id="cnav1" class="PageChild_NavItem"> 
                    <span class="PageChild_NavR"> 
                          <a href="javascript:void(0);" class="pageTabButton title_tab"
								targetTab="#ByStatesTab">审批中的</a>
                    </span>
                </div>  
  				<div id="cnav2" class="PageChild_NavItem"> 
                    <span class="PageChild_NavR"> 
          				 <a href="javascript:void(0);" class="pageTabButton currentTabButton title_tab"
								targetTab="#ByCheckResultTab">查看审批单</a>
                    </span>
                </div>  
			<div class="clear">
			</div>
		</div>
		<div id="ByStatesTab" class="pageTab"> 
			<div class="PageChild_List">
				
				<table  width="100%" border="0" cellspacing="0"
					style="text-align: left">
					<tbody class="PageChild_List_head">
						<tr>
							<td width="16">
								<img src="themes/images/default/icons/pcde_314.png"
									width="16" height="16" />
							</td>
							<td>
								订单号
							</td>
							<td>
								申请时间
							</td>
							<td>
								到达部门
							</td>
							<td>
								订单状态
							</td>
							
						</tr>
					</tbody>
					<tbody class="PageChild_List_main" style="text-align: left">
						<s:if test="checkingList != null && checkingList.size != 0">
						<s:iterator value="checkingList" var="item" status="no">
							<!-- 物资类型列表开始 -->
							<tr class='td_no_bord'>
								<td class="td_width25">
									<s:property value="#no.count" />
								</td>
								<td>
									<span><s:property value="#item.orderId" /> </span>
								</td>
								<td>
									<span> <s:property value="#item.createTime" />
									</span>
								</td>
								<td>
									<span><s:property value="#item.states" />
									</span>
								</td>

								

								<td>
	正在审核..
								</td>
							</tr>
						</s:iterator>
						</s:if><s:else>
						<tr><td colspan="5">无记录</td></tr>
					</s:else>
					</tbody>
				</table>
			</div>
		</div>
		<!-- 下边栏 -->
		<div id="ByCheckResultTab" class="pageTab">
			<div class="PageChild_Where">
				<table>
					<tr>
						<td>
							根据状态查询:<s:select id="states" list="#{-1:'审核失败',-2:'审核成功',-3:'已归还'}" theme="simple" listKey="key" listValue="value"  headerKey="0" headerValue="--全部--" value="states"></s:select>
						</td>
						<td>
							<button id="SearchButton" class="o-btn"  onclick="goToPage(1)">
								搜索
							</button>
							&nbsp; <input type="button" value="申请物资"
						onclick='location="goodsOrder!toApply.action"' class="o-btn"/>
						</td>
						
						 
					</tr>
				</table>
				<s:if test="count!=null">
								<span id="lbl_list_count">
								 共搜索到 <b>${count}</b> 条符合条件的记录。</span>
								
							</s:if> 
			</div>

			<!-- 下边栏列表 -->
			<div class="PageChild_List">
				<table width="100%" border="0" cellspacing="0"
					style="text-align: left">
					<tbody class="PageChild_List_head">
						<tr>
							
							<td>
								订单号
							</td>
							<td>
								申请时间
							</td>
							<td>
								归还时间
							</td>
							<td>
								订单状态
							</td>
							
						</tr>
					</tbody>
					<tbody class="PageChild_List_main" style="text-align: left">
						<s:if test="list != null && list.size != 0">
						<s:iterator value="list" var="item">
							<tr class='td_no_bord'>
								
								<td>
									<span><s:property value="#item.orderId" /> </span>
								</td>
								<td>
									<span> <s:property value="#item.createTime" />
									</span>
								</td>
								<td>
									<span><s:property value="#item.returnTime" />&nbsp;
									</span>
								</td>
								<td>
							<!-- 判断如果是审批通过的状态，则在备注栏显示“归还”按钮 ，如果正在审批，则在备注栏显示目前审批单所到达的部门 -->
							
								<s:if test="#item.states==-3">
									已归还
								</s:if>
		<s:elseif test="#item.states==-1">审核失败</s:elseif>
		<s:elseif test="#item.states==-2">审核成功(未归还)</s:elseif>
		<s:else>正在审核.....</s:else>
		
								</td>
							</tr>
						</s:iterator>
						</s:if><s:else>
						<tr><td colspan="5">无记录</td></tr>
					</s:else>
					</tbody>
				</table>
			</div>
			<!--分页导航开始-->
			<div id="divTopPageNavi" class="list_r_title_text3">
			<s:if test="currpage<=1">
				<span class='list_r_title_text3a'> <img
						src=" themes/images/default/page_up_gray.gif"></img> </span>

			</s:if>
			<s:else>
				<span class='list_r_title_text3a'> <a name="link_page_prev"
					id="link_page_prev" href="javascript:void(0);"
					currentPage="${currpage-1}"> <img
							src=" themes/images/default/page_up.gif"></img> </a> </span>
			</s:else>
			<span class='list_r_title_text3b'> 第${currpage }页/共${totalpage
				}页 </span>
			<s:if test="currpage>=totalpage">
				<span class='list_r_title_text3a'> <img
						src=" themes/images/default/page_down_gray.gif"></img> </span>
			</s:if>
			<s:else>
				<span class='list_r_title_text3a'> <a name="link_page_next"
					id="link_page_next" href="javascript:void(0);"
					currentPage="${currpage+1 }"> <img
							src=" themes/images/default/page_down.gif"></img> </a> </span>
			</s:else>
			<span id="goToPageTextArea"><input type="text"
					class="easyui-numberbox" id="goPageNum" max="${totalpage}" min="1" />
				<input type="button" id="turnToPageButton" value="GO" />
			</span>
			<!--分页导航结束-->
		</div>
		</div>
	</body>
</html>
